package awesome.request;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Holds the list of requests in a queue. BlockingQueue is
 * used to block processors until a request is avaliable.
 * 
 * 
 * @author Chris Carpenter
 * 
 */
public class RequestQueue {
	private BlockingQueue<Request> queue;
	
	public RequestQueue() {
		this.queue = new LinkedBlockingQueue<Request>();
	}
	
	public void add (Request newRequest) {
		queue.add(newRequest);
	}
	
	public Request take() throws InterruptedException {
		return queue.take();
	}
	
}
